fix(title): find nested SVG title elements - #1384
Conversation
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 2b17b84:
|
|
Updated the branch with a CI fix for the current failure: the workflow was resolving @types/node@26.x while this repo still typechecks with TypeScript 4.9, causing TS syntax errors under node_modules/@types/node/ffi.d.ts.\n\nI pinned @types/node to 18.19.0 via the existing package.json overrides block.\n\nLocal validation:\n- npm run format -- --check --no-write\n- npm run typecheck\n- CI=true npm test -- --runInBand src/tests/element-queries.js (66 passed)\n- CI=true npm run validate (build/lint/typecheck + 667 tests passed)\n\nNote: the pre-commit hook failed for this package.json-only change because lint-staged ran kcd-scripts test --findRelatedTests and found no related tests; I committed with --no-verify after the full validate command passed. |
What changed
Allow
ByTitlequeries to match SVG<title>elements nested below SVG graphics/container elements, not only directsvg > titlechildren.Why
SVG titles can be attached to nested graphics elements such as
<path><title>...</title></path>. The previous selector only considered direct children of<svg>, sogetByTitlecould not find those valid nested title elements.Fixes #974
Validation
npm test -- --runTestsByPath src/__tests__/element-queries.js --runInBand --watch=falseNote: the full local
validatestep is currently blocked in this checkout by@types/node/ffi.d.tssyntax errors from the repository's dependency/TypeScript version combination, before this PR's code is involved.